﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApPSCUtilities
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

public class CApPSCUtilities
{
  public TxObjectList GetAllLocationsBetweenTwoFlowLocOps(
    TxObjectFlowLocationOperation firstLoc,
    TxObjectFlowLocationOperation secondLoc)
  {
    TxObjectList betweenTwoFlowLocOps = new TxObjectList();
    if (TxObjectFlowLocationOperation.op_Inequality(firstLoc, (ITxObject) null) && TxObjectFlowLocationOperation.op_Inequality(secondLoc, (ITxObject) null))
    {
      TxObjectFlowOperation collection1 = firstLoc.Collection as TxObjectFlowOperation;
      TxObjectFlowOperation collection2 = secondLoc.Collection as TxObjectFlowOperation;
      if (TxObjectFlowOperation.op_Inequality(collection1, (ITxObject) null) && TxObjectFlowOperation.op_Inequality(collection2, (ITxObject) null) && TxObjectFlowOperation.op_Equality(collection1, (ITxObject) collection2))
      {
        int num1 = collection1.GetIndexOfChild((ITxObject) firstLoc);
        int num2 = collection1.GetIndexOfChild((ITxObject) secondLoc);
        if (num1 > num2)
        {
          int num3 = num1;
          num1 = num2;
          num2 = num3;
        }
        for (int index = num1; index <= num2; ++index)
        {
          ITxObject childAt = collection1.GetChildAt(index);
          if (childAt != null)
            ((Collection<ITxObject>) betweenTwoFlowLocOps).Add(childAt);
        }
      }
    }
    return betweenTwoFlowLocOps;
  }
}
